/*
 * 人人信用管理有限公司版权所有.
 * 
 * @Description:
 * 
 * @author: liyuliang
 * 
 * @date: 20 Apr 2017 10:44:16 am
 * 
 * 注意：本内容仅限于人人信用管理有限公司内部传阅，禁止外泄以及用于其他的商业目的.
 */

package com.rrx360.common.web.tag.auth;

import javax.servlet.jsp.JspException;

import com.rrx360.common.web.auth.AuthUtil;
import com.rrx360.common.web.tag.ref.BaseTag;

public class AuthTag extends BaseTag {

  private static final long serialVersionUID = 8504211072409552486L;

  public int doStartTag() throws JspException {
    String[] auths = ((String) this.getAttribute("auths")).split(",");
    if (AuthUtil.auth(auths)) {
      return EVAL_BODY_INCLUDE;
    } else {
      return SKIP_BODY;
    }
  }
}
